<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>修改教练信息</title>
<%@ include file="/WEB-INF/layouts/comm/form.jsp"%>
</head>
<body>
	<div class="mod_header">
		<div class="title">
			<h2 id="h_title">修改教练信息</h2>
		</div>
	</div>
	<ol class="breadcrumb">
		<li><a href="#">管理设置</a></li>
		<li><a href="${ctx}/webCustomer/train/index">教练管理</a></li>
		<li class="active">修改教练信息</li>
	</ol>
	<div class="mod_basic">
		<div class="title">
			<h3>教练设置</h3>
		</div>

		<div class="content">
			<div class="sub_content">
				<form class="form-horizontal" id="train_form" method="post">
					<div class="form-group">
						<label for="examTime" class="col-sm-2 control-label">姓名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="trainName" value="${train.trainName}"
								name="trainName">
						</div>
					</div>
					<div class="form-group">
						<label for="resTime" class="col-sm-2 control-label">电话</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="trainTel" value="${train.trainTel}"
								name="trainTel">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">身份证</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="idCard" name="idCard" value="${train.idCard}">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">教练编号</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="trainNo" value="${train.trainNo}"
								name="trainNo">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">分校名称</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="schoolName" value="${train.schoolName}"
								name="schoolName">
						</div>
					</div><div class="form-group">
						<label for="title" class="col-sm-2 control-label">练车地址</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="carAddr" value="${train.carAddr}"
								name="carAddr">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">绑定码</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="password" value="${train.password}"
								name="password">
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div>

				</form>
			</div>
		</div>
	</div>
	<footer_body> <script>
		base.menu.active('menu_203');

		base.form.validation("#train_form", {
			rules : {
				trainName : {
					required : true
				},
				trainTel : {
					required : true
				},
				idCard : {
					required : true
				},
				password : {
					required : true
				},
				carAddr : {
					required : true
				},
				trainNo : {
					required : true
				},
				schoolName : {
					required : true
				}
			},
			ignore : ""
		});

		base.form
				.ajaxSubmit({
					formid : '#train_form',
					cbfun : function(data) {
						if (data.data == true) {
							BootstrapDialog
									.show({
										message : "修改成功",
										size : BootstrapDialog.SIZE_SMALL,
										buttons : [
												{
													label : '继续修改',
													cssClass : 'btn-success',
													action : function(dialogRef) {
														window.location.href = "${ctx}/webCustomer/train/update?id=${train.id}";
													}
												},
												{
													label : '查看教练信息',
													cssClass : 'btn-warning',
													action : function(dialogRef) {
														window.location.href = "${ctx}/webCustomer/train/index";
													}
												} ]
									});
						} else {
							BootstrapDialog.alert("保存失败，请重试");
						}
					}
				});
	</script> </footer_body>
</body>
</html>